package com.example.demo.controller;

import com.example.demo.entity.Artical;
import com.example.demo.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@CrossOrigin
public class Mailcontroller {
    @Autowired
    MailService mailService;


    @GetMapping("fasong")
    public void fasong(Artical artical) {
        String content = "借书人：" + artical.getName() + "     帐号名：" + artical.getUsername();
        content += "     请火速还书！" ;
        mailService.sendSimpleMail(artical.getEmail(), "图书室还书公告", content);			//这里邮箱是发送的目的邮箱
    }
}
